{% if profile_form.errors %}
    <div class="form-errors">
        {% for field in profile_form %}
            {% for error in field.errors %}
                <p class="form-error red-color"><strong>*{{field.label}}: {{ error|escape }}</strong></p>
            {% endfor %}
        {% endfor %}
        {% for error in profile_form.non_field_errors %}
            <p class="form-error red-color"><strong>*{{ error|escape }}</strong></p>
        {% endfor %}
    </div>
{% endif %}
{# Form design is borrowed from "http://www.sanwebe.com/2014/08/css-html-forms-designs" #}
<form class="djacket-form" action="{% url 'user_profile' %}" role="form" method="POST" enctype="multipart/form-data">
    {% csrf_token %}
    <ul>
        <li>
            <label for="id_avatar">Avatar Image</label>
            <input id="id_avatar" name="avatar" type="file" value="{{ profile_form.user.profile.avatar }}">
            <span>Choose an image for your avatar.</span>
        </li>
        <li>
            <label for="id_birthdate">Birthdate</label>
            <input id="id_birthdate" name="birthdate" type="date" value="{{ profile_form.user.profile.birthdate|date:'Y-m-d' }}">
            <span>Let us know when this legend was born.</span>
        </li>
        <li>
            <input class="success" type="submit" value="Save Changes">
        </li>
    </ul>
</form>
{# Form design is borrowed from "http://www.sanwebe.com/2014/08/css-html-forms-designs" #}
